import {
    Client, LocalAddress, CryptoUtils, LoomProvider, User
} from 'loom-js';
import Web3 from 'web3'
// import MyCoin from '../contracts/MyCoin'

export default class MyCoin {
    async loadCoin() {
        this.privateKey = CryptoUtils.generatePrivateKey()
        this.publicKey = CryptoUtils.publicKeyFromPrivateKey(this.privateKey)
        this.client = new Client(networkId, writeUrl, readUrl)
        this.client.on('error', msg => {
        console.error('Error on connect to client', msg)
        console.warn('Please verify if loom command is running')
        })
        this.web3 = new Web3(new LoomProvider(this.client, this.privateKey))
    }

};